<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>哄女孩子开心器</title>
    <link rel="stylesheet" href="https://heerey525.github.io/layui-v2.4.3/layui-v2.4.5/css/layui.css">
    <script src="./lib/layui-v2.5.7/layui/layui.all.js"></script>
    
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        html {
            background-image: url(https://w.wallhaven.cc/full/39/wallhaven-39mx69.jpg);
            background-position: center;
            background-size: 100% auto;
            background-repeat: no-repeat;
        }

        .w {
            width: 100%;
            /* height: 400px; */
            margin: 10px auto;

            /* background: red; */
        }

        ul {
            list-style: none;
            width: 80%;
            /* height: 10%; */
            /* border: 1px solid black; */
            margin: 0 auto;
        }

        li {
            width: 100%;
            /* height: 100%; */
            margin: auto;
            padding: 10px;
        }
    </style>
</head>

<body>
    <div class="w" id="app">
        <button class="layui-btn" @click="getlist">获取情话</button>
        <ul>
            <li v-for="(item,index) in list">
                <h3>{{index+1}}.{{item}}</h3>
                <hr>
            </li>

        </ul>

    </div>
    <script>
        var $ = layui.$;
        // console.log(jQuery);
        var vm = new Vue({
            el: "#app",
            data: {
                list: []
            },
            methods: {
                getlist() {
                    console.log(1)
                    $.ajax({
                        mothod: "GET",
                        url: "https://api.lovelive.tools/api/SweetNothings/10/Serialization/json?genderType=M",
                        success: data => {
                            console.log(data)
                            this.list = data.returnObj;
                            // console.log(this.list)
                        }
                    });
                },
                show() {
                    console.log(this.list);
                }
            },
            created() {
                this.getlist();
                this.show()
            },
        })
    </script>

</body>

</html>